package net.ikenway.springboot.demo.Model.Dto;

import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import net.ikenway.springboot.demo.Model.Entity.Address;
import net.ikenway.springboot.demo.Model.Entity.User;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;

/**
 * @author MasterKenway <zk@ikenway.net>
 * @Description
 * @date Created Date 12/10/2020
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserDto implements Serializable {
    private Long userId;
    private String avatar;


    @SerializedName(value = "name", alternate = {"Name"})
    private String name;

    @NotNull(message = "用户名不能为空")
    @NotEmpty(message = "用户名不能为空")
    @Size(min = 2, max = 50, message = "用户名长度不能超过50")
    @SerializedName(value = "username", alternate = {"Username"})
    @Email(message = "邮箱不合法")
    private String username;

//    private String wxOpenId;
    private Boolean enable;

    private User.Identity identity;

//    private List<Address> address;
}
